Skip to content

Fix sync.sh YAML dequoting and default TICKET_LABEL_CREATION_ALLOWED#69

Merged
sebastientaggart merged 1 commit into
devfrom
feature/sync-yaml-dequote-and-label-default
Apr 8, 2026
Merged

Fix sync.sh YAML dequoting and default TICKET_LABEL_CREATION_ALLOWED#69
sebastientaggart merged 1 commit into
devfrom
feature/sync-yaml-dequote-and-label-default

Conversation

@sebastientaggart

Copy link
Copy Markdown
Member

Fixes two sync bugs that caused rendered skill files to contain broken content for common configurations.

1. VERSION_READ_CMD rendered as an unterminated shell command. parse_yaml_simple used .strip('"').strip("'"), which greedily strips all trailing quote characters. For the default template value "node -p \"require('./package.json').version\"" this produced node -p \"require('./package.json').version\ — missing a closing quote, with a trailing backslash. Copy-paste into a shell failed.

2. {{TICKET_LABEL_CREATION_ALLOWED}} leaked through to rendered skill files. The start skill references this setting, but the default .codecannon.yaml template ships it commented out. Projects that configured a ticket-label pool without uncommenting the key ended up with raw mustache placeholders in the rendered start skill.

Changes

  • New _dequote() helper in sync.sh that strips exactly one pair of matching outer quotes and decodes \" / \\ in double-quoted values. Wired into the three value sites in parse_yaml_simple and parse_frontmatter, plus the list-item sites.
  • TICKET_LABEL_CREATION_ALLOWED defaults to "false" when absent from the project config, matching the documented default in templates/codecannon.yaml and docs/config-reference.md.

No skill-file changes required — the placeholders already render correctly once the sync engine behaves.

Verification

  • ./sync.sh --validate passes.
  • ./sync.sh --dry-run against this repo is a clean no-op (this repo uses cat VERSION and has all label keys set explicitly, so it's unaffected by either bug).
  • Parsing the default templates/codecannon.yaml now yields VERSION_READ_CMD = 'node -p "require(\'./package.json\').version"' with balanced quotes.

Issue #68

@sebastientaggart

Copy link
Copy Markdown
Member Author

Review Summary

Verdict: APPROVE

Findings

  • [NOTE] The _dequote helper uses \x00 as a placeholder during backslash decoding; this is safe for the YAML subset parsed here since config values are unlikely to contain literal NULs, but worth a mental note if the parser is ever extended to binary-ish strings.

Both fixes are correctly scoped. The greedy .strip('"').strip("'") bug is properly replaced by a single-pair dequote with escape decoding, and the decode order (\\ first via placeholder, then \") correctly avoids double-processing escaped backslashes. The TICKET_LABEL_CREATION_ALLOWED default matches the commented-out value in templates/codecannon.yaml line 83 and the documented default. Changes are minimal and do not regress existing list/dict/frontmatter parsing paths.

@sebastientaggart
sebastientaggart merged commit 03755db into dev Apr 8, 2026
2 checks passed
@sebastientaggart
sebastientaggart deleted the feature/sync-yaml-dequote-and-label-default branch April 8, 2026 16:30
This was referenced Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant